// 视频任务相关类型
export interface VideoTask {
  id: string
  title: string
  description?: string
  original_filename: string
  target_platform: string
  status: 'pending' | 'processing' | 'completed' | 'failed'
  progress: number
  current_step?: string
  error_message?: string
  output_video_url?: string
  thumbnail_url?: string
  duration?: number
  format?: string
  file_size?: number
  processing_time?: number
  created_at: string
  updated_at?: string
  started_at?: string
  completed_at?: string
}

export interface VideoTaskList {
  tasks: VideoTask[]
  total: number
  page: number
  size: number
}

// 平台模板相关类型
export interface PlatformTemplate {
  id: number
  platform_name: string
  template_name: string
  display_name: string
  description?: string
  target_duration?: number
  max_segments?: number
  is_active: boolean
}

// 视频上传相关类型
export interface VideoUploadRequest {
  title: string
  description?: string
  target_platform: string
}

export interface VideoUploadResponse {
  task_id: string
  message: string
}

// 视频预览相关类型
export interface VideoPreview {
  task_id: string
  video_url: string
  thumbnail_url?: string
  duration?: number
  title: string
  platform: string
}

// 通用API响应类型
export interface ApiResponse<T = any> {
  code?: number
  message?: string
  data?: T
}

// 分页请求参数
export interface PaginationParams {
  page?: number
  size?: number
  status?: string
}

// 文件上传进度
export interface UploadProgress {
  progress: number
  loaded: number
  total: number
}

// WebSocket消息类型
export interface WebSocketMessage {
  type: 'progress' | 'status' | 'error' | 'complete'
  task_id: string
  data: any
  timestamp: number
}

// 进度更新消息
export interface ProgressUpdate {
  status: string
  progress: number
  current_step?: string
  message?: string
}

// 组件Props类型
export interface BaseComponentProps {
  loading?: boolean
  disabled?: boolean
}

// 表单验证规则
export interface FormRule {
  required?: boolean
  message?: string
  trigger?: 'blur' | 'change'
  min?: number
  max?: number
  validator?: (rule: any, value: any, callback: any) => void
}

export interface FormRules {
  [key: string]: FormRule[]
}